<div>
<form class="form-horizontal" role="form" name="tradeLogQueryForm" novalidate>
  <div class="form-ctrl md-whiteframe-z1">
    <div class="form-search" style="height:160px;" ng-class="{true: 'shou'}[flag.formIsFold]" >
      <div>
        <label >系统</label>
        <md-select ng-model="tradeLog.systemCode">
          <md-select-label>{{tradeLog.systemCode ? _getNames(tradeLog.systemCode,'name',selector.systems) : "统一支付"}}</md-select-label>
          <md-option ng-value="system"  ng-repeat="system in selector.systems">{{system.name}}</md-option>
        </md-select>
      </div>
      <div>
        <md-input-container flex>
          <label >流水号</label>
          <input ng-model="tradeLog.serialNum" maxlength="32" name="serialNum" pattern="^[A-Za-z0-9]+$">
          <div ng-messages="tradeLogQueryForm.serialNum.$error">
            <div ng-message="pattern">请输入数字或字母</div>
          </div>
        </md-input-container>
      </div>
      <div>
        <md-input-container flex>
          <label >查询时间</label>
          <input type="date" ng-model="date.startTime"  time-validate="day" required name="startTime" end-time="date.endTime">
          <div ng-messages="tradeLogQueryForm.startTime.$error">
            <div ng-message="time-error">查询时间不应大于当前时间</div>
            <div ng-message="date">请正确输入时间</div>
          </div>
        </md-input-container>
      </div>
      <div>
        <md-input-container flex>
          <label >报文内容</label>
          <input ng-model="tradeLog.dataMsg" maxlength="50" name="dataMsg">
        </md-input-container>
      </div>
    </div>
    <i class="glyphicon glyphicon-chevron-up shrinkage" ng-show="flag.isQuery" ng-click="flag.formIsFold=true" ></i>
    <md-button ng-click="getTradeLogQuery()" class="md-fab md-primary md-hue-1" ng-disabled="tradeLogQueryForm.$invalid" aria-label="Profile">
      <i class="glyphicon glyphicon-search"  ng-show="!flag.formIsFold"></i>
      <i class="glyphicon glyphicon-arrow-down" style="margin-top:28px;" ng-show="flag.formIsFold"></i>
    </md-button>
  </div>
</form>
<div class="table-info">
  <div>
    <div class="table-detail">
      <div class="t_r" style="padding: 30px 0px;">
        <table class="table table-bordered">
          <caption style="text-align:center;font-size:large;font-weight:bold;color:black">{{viewObj.title}}</caption>
          <thead>
            <tr>
              <th width="{{100/viewObj.keyNames.length}}%" ng-repeat="key in viewObj.keyNames">{{key}}</th>
            </tr>
          </thead>
          <tbody>
            <tr ng-repeat="log in viewObj.logs">
              <td style="word-wrap:break-word; word-break:break-all; "width="{{100/viewObj.keyNames.length}}%" ng-repeat="key in viewObj.keyNames" title="{{key === viewObj.returnCodeName ? viewObj.Return_Code[log[key]] : log[key] }}">{{log[key]}}</td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
    <div ng-if="flag.isQuery">
      <ds-page
              total-count=pageObj.totalCount
              page-size=pageObj.pageSize
              page-itmes=pageItmes
              param=viewObj.param
              current-page=pageObj.currentPage
              go-page="turnToPage(viewObj.param)"
              page-size-change="pageSizeChange(pageObj.pageSize)"
              show-max-page="5"
              first-text="<<"
              last-text=">>"
              previous-text="<"
              next-text=">"
              >
      </ds-page>
    </div>
  </div>
</div>
</div>